import React, { FC, DragEvent } from 'react';
import { Card } from 'antd';

interface IFormCard {
    title: string,
    onHandleDrag: (e: DragEvent<any>) => void,
    value: string
}
const FormCard: FC<IFormCard> = (props) => {
    const { title, onHandleDrag, value } = props;

    return (
        <div draggable onDrag={onHandleDrag} key={value} data-cardType={value}>
            <Card
                onClick={(e) => e.preventDefault()}
                hoverable
                cover={
                    <img
                        draggable={false}
                        onDragStart={(e) => {
                            // e.preventDefault();
                        }}
                        alt="example"
                        src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
                    />
                }
            >
                {title}
            </Card>
        </div>
    )
};

export default FormCard;